//
//  ViewController.m
//  SignName
//
//  Created by tgs on 2017/7/11.
//  Copyright © 2017年 tgs. All rights reserved.
//

#import "ViewController.h"
#import "SignNameView.h"

//weakSelf
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
@interface ViewController ()

@property (nonatomic, strong) SignNameView *checkPersonSign;
@property (weak, nonatomic) IBOutlet UIImageView *imgView;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
  
}
- (IBAction)clickSign:(id)sender {
    self.checkPersonSign = [[SignNameView alloc]
                            initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 500)];
    self.checkPersonSign.ContentView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    self.checkPersonSign.ContentView.center =
    CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);
    
    [self.checkPersonSign show];
    WS(weakSelf);
    self.checkPersonSign.block = ^(void){
        NSLog(@"没有签名内容");
    };
    [self.checkPersonSign setGetSignNameImage:^(UIImage *image) {
        weakSelf.imgView.image = image;
    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
